home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / COMPTOOL / VBMAIL / MAILLST.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1996-09-16  |  6.9 KB  |  211 lines

  1. VERSION 5.00
  2. Begin VB.Form MailLst 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Mail List"
  5.    ClientHeight    =   3552
  6.    ClientLeft      =   2076
  7.    ClientTop       =   3276
  8.    ClientWidth     =   6624
  9.    Icon            =   "MAILLST.frx":0000
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   3552
  13.    ScaleWidth      =   6624
  14.    Begin VB.PictureBox Tools 
  15.       Align           =   2  'Align Bottom
  16.       BackColor       =   &H00C0C0C0&
  17.       BorderStyle     =   0  'None
  18.       Height          =   615
  19.       Left            =   0
  20.       ScaleHeight     =   612
  21.       ScaleWidth      =   6624
  22.       TabIndex        =   2
  23.       Top             =   2940
  24.       Width           =   6624
  25.       Begin VB.Line Line1 
  26.          BorderColor     =   &H00FFFFFF&
  27.          Index           =   1
  28.          X1              =   0
  29.          X2              =   6660
  30.          Y1              =   15
  31.          Y2              =   15
  32.       End
  33.       Begin VB.Line Line1 
  34.          BorderColor     =   &H00000000&
  35.          Index           =   0
  36.          X1              =   0
  37.          X2              =   6660
  38.          Y1              =   0
  39.          Y2              =   0
  40.       End
  41.       Begin VB.Image PrtImage 
  42.          Height          =   384
  43.          Left            =   1200
  44.          Picture         =   "MAILLST.frx":030A
  45.          Top             =   60
  46.          Width           =   384
  47.       End
  48.       Begin VB.Image Trash 
  49.          Height          =   384
  50.          Left            =   300
  51.          Picture         =   "MAILLST.frx":0614
  52.          Top             =   60
  53.          Width           =   384
  54.       End
  55.    End
  56.    Begin VB.ListBox MList 
  57.       Height          =   2184
  58.       Left            =   90
  59.       MultiSelect     =   2  'Extended
  60.       TabIndex        =   0
  61.       Top             =   360
  62.       Width           =   6495
  63.    End
  64.    Begin VB.Label Headings 
  65.       AutoSize        =   -1  'True
  66.       BackStyle       =   0  'Transparent
  67.       Caption         =   "Listbox Headings"
  68.       BeginProperty Font 
  69.          Name            =   "Courier New"
  70.          Size            =   9
  71.          Charset         =   0
  72.          Weight          =   400
  73.          Underline       =   0   'False
  74.          Italic          =   0   'False
  75.          Strikethrough   =   0   'False
  76.       EndProperty
  77.       Height          =   225
  78.       Left            =   180
  79.       TabIndex        =   1
  80.       Top             =   60
  81.       Width           =   1680
  82.    End
  83.    Begin VB.Image NewMail 
  84.       Height          =   384
  85.       Left            =   5880
  86.       Picture         =   "MAILLST.frx":091E
  87.       Top             =   2820
  88.       Visible         =   0   'False
  89.       Width           =   384
  90.    End
  91.    Begin VB.Image nonew 
  92.       Height          =   384
  93.       Left            =   5280
  94.       Picture         =   "MAILLST.frx":0C28
  95.       Top             =   2880
  96.       Visible         =   0   'False
  97.       Width           =   384
  98.    End
  99. Attribute VB_Name = "MailLst"
  100. Attribute VB_GlobalNameSpace = False
  101. Attribute VB_Creatable = False
  102. Attribute VB_TemplateDerived = False
  103. Attribute VB_PredeclaredId = True
  104. Attribute VB_Exposed = False
  105. ' Module variable to hold MouseDown position information.
  106. Dim ListX, ListY
  107. Private Sub Form_Load()
  108.     ' Resize the form.
  109.     Height = 3945
  110.     Call Tools_Resize
  111.      ' Set list box headings.
  112.      a$ = Mid$(Format$("From", "!" + String$(25, "@")), 1, 25)
  113.      b$ = Mid$(Format$("Subject", "!" + String$(35, "@")), 1, 35)
  114.      c$ = "Date"
  115.      Headings = a$ + b$ + c$
  116. End Sub
  117. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  118.     ' If the user is closing the application, let this form unload.
  119.     If UnloadMode = 4 Then
  120.         ' Unloading is permitted.
  121.     Else
  122.         ' If the user is still logged on, minimize the form rather than closing it.
  123.         If VBMail.MapiMess.SessionID <> 0 Then
  124.             Me.WindowState = 1
  125.             Cancel = True
  126.         End If
  127.     End If
  128. End Sub
  129. Private Sub Form_Resize()
  130.     ' If the form isn't minimized, resize the list box to fit the form.
  131.     If WindowState <> 1 Then
  132.         If VBMail.DispTools.Checked Then
  133.             xHeight% = Tools.Height
  134.         Else
  135.             xHeight% = 0
  136.         End If
  137.         ' Check for the minimum form height.
  138.         If Height < 2500 - xHeight% Then
  139.             Height = 2500
  140.             Exit Sub
  141.         End If
  142.         MList.Width = ScaleWidth - MList.Left - 90
  143.         MList.Height = ScaleHeight - 90 - MList.Top - xHeight%
  144.     End If
  145. End Sub
  146. Private Sub MList_Click()
  147. ' Set the message index and enable the
  148. ' Previous and Next buttons as needed.
  149.     Select Case MList.ListIndex
  150.         Case 0
  151.             VBMail.Previous.Enabled = False
  152.         Case MList.ListCount - 1
  153.             VBMail.Next.Enabled = False
  154.         Case Else
  155.             VBMail.Previous.Enabled = True
  156.             VBMail.Next.Enabled = True
  157.     End Select
  158.     VBMail.MapiMess.MsgIndex = MList.ListIndex
  159. End Sub
  160. Private Sub MList_DBLClick()
  161. ' Check to see if the message is currently viewed,
  162. ' and if it isn't, load it into a new form.
  163.     If Not MailLst.MList.ItemData(MailLst.MList.ListIndex) Then
  164.        Dim Msg As New MsgView
  165.        Call LoadMessage(MailLst.MList.ListIndex, Msg)
  166.        MailLst.MList.ItemData(MailLst.MList.ListIndex) = True
  167.     Else
  168.         ' Search through the active windows to
  169.         ' find the window with the correct message to view.
  170.         For i = 0 To Forms.Count - 1
  171.             If TypeOf Forms(i) Is MsgView Then
  172.                 If Val(Forms(i).Tag) = MailLst.MList.ListIndex Then
  173.                     Forms(i).Show
  174.                     Exit Sub
  175.                 End If
  176.             End If
  177.         Next i
  178.      End If
  179. End Sub
  180. Private Sub MList_KeyPress(KeyAscii As Integer)
  181.     ' If the user presses ENTER, process the action as a DblClick event.
  182.     If KeyAscii = 13 Then
  183.         Call MList_DBLClick
  184.     End If
  185. End Sub
  186. Private Sub MList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  187.     ' Save the X and Y positions to determine the start of the drag-and-drop action.
  188.     ListX = X
  189.     ListY = Y
  190. End Sub
  191. Private Sub MList_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  192.     ' If the mouse button is down and the X,Y position has changed, start dragging.
  193.     If Button = 1 And ((X <> ListX) Or (Y <> ListY)) Then
  194.         MList.Drag 1
  195.     End If
  196. End Sub
  197. Private Sub PrtImage_DragDrop(Source As Control, X As Single, Y As Single)
  198.     ' Same as File.PrintMessage on the VBMAIL File menu.
  199.     Call PrintMail
  200. End Sub
  201. Private Sub Tools_Resize()
  202.     ' Adjust the width of the lines on the top of the toolbar.
  203.     Line1(0).X2 = Tools.Width
  204.     Line1(1).X2 = Tools.Width
  205.     Tools.Refresh
  206. End Sub
  207. Private Sub Trash_DragDrop(Source As Control, X As Single, Y As Single)
  208.     ' Delete a message (Delete Button or Edit.Delete).
  209.    Call DeleteMessage
  210. End Sub
  211.